package com.hsd.znsh.entity;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-04-09 10:42:22
 */
@Data
@Entity
@Table(name ="tbl_sensor_group")
public class SensorGroup {

    /*主键*/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /*传感器组名称*/
    @NotBlank(message = "传感器名称不能为空")
    private String sensorGroupName;

    /*传感器组编号*/
    @NotNull(message = "传感器组编号不能为空")
    private Integer sensorGroupIndex;

    /*传感器组类别*/
    @NotNull(message = "传感器组类别不能为空")
    private Integer sensorGroupType;

    /*温湿度传感器设备编号*/
    private String thSn;

    /*CO2传感器设备编号*/
    private String co2Sn;

    /*光照传感器*/
    private String lightSn;

    /*水体传感器*/
    private String waterSn;

    /*创建人id*/
    private Integer createUserId;

    /*创建时间*/
    @CreationTimestamp
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDateTime;

    /*修改时间*/
    @UpdateTimestamp
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateDateTime;

    /*在地图上的left值*/
    @NotNull(message = "在地图上的坐标不能为空")
    private Double leftValue;

    /*在地图上的top值*/
    @NotNull(message = "在地图上的坐标不能为空")
    private Double topValue;
}
